package com.four.controller;

import com.four.pojo.Member;
import com.four.pojo.Orders;
import com.four.pojo.Service;
import com.four.service.impl.MemberKDServiceImpl;
import com.four.service.impl.OrdersServiceImpl;
import com.four.service.impl.ServiceServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author 于志豪
 * @create 2021-10-29 20:30
 */

@Controller
public class MemberKDController {

    @Autowired
    @Qualifier("ordersServiceImpl")
    private OrdersServiceImpl service;

    @Autowired
    @Qualifier("memberKDServiceImpl")
    private MemberKDServiceImpl memberKDService;

    @Autowired
    @Qualifier("serviceServiceImpl")
    private ServiceServiceImpl service1;

    @RequestMapping("/findAllKD")
    public String findAllKD(Model model, Member member){//开单查询
        List<Member> allKD = memberKDService.findAllKD(member);
        model.addAttribute("allKD",allKD);
        System.out.println(allKD);

        List<Orders> allJs = service.findAllJs();
        model.addAttribute("allJs",allJs);

        List<Service> all = service1.findAll();
        model.addAttribute("all",all);//服务下拉

        return "/new_Order.jsp";
    }
}
